<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML >
<html>
<head>
<base href="<%=basePath%>">

<title></title>
<link rel="stylesheet" href="<%=basePath%>/css/result.css"
	type="text/css"></link>
<link rel="stylesheet" href="<%=basePath%>/css/style.css"
	type="text/css"></link>
<style type="text/css">
.float_left {
	list-style-type: none;
	float: left;
	width: 90px;
}

.float_left1 {
	text-align: center;
	list-style-type: none;
	float: left;
	width: 120px;
}

.clear_float {
	clear: both;
}
</style>
</head>

<body>

	<div style="height: 70px;"></div>
	<div class="main-div">
		<div>你好${userInfo.username }！欢迎来到首页</div>
	</div>
	<div class="main-div">
		<div style="margin-top: 30px; float: left">
			<div style="line-height: 30px">
				<a href="blog/findBlog?id=+${userInfo.id}+&pagesize=5&indexpage=1">微博管理</a>
			</div>

			<c:if test="${userInfo.supper eq 0 }">
				<div style="line-height: 30px">
					<a href="<%=basePath%>/jsp/editAccount.jsp">账户管理 </a>
				</div>
			</c:if>
			<c:if test="${userInfo.supper eq 1 }">
				<a href="users/findAll?pagesize=5&indexpage=1">账户管理 </a>
			</c:if>
		</div>
		<div style="margin-top: 30px; float: left;margin-left: 50px">
			<h4>账户管理列表</h4>
			<div style="margin-top: 30px;">
				<ul style="margin-top: 30px;">
					<li class="float_left1">用户名</li>
					<li class="float_left1">昵称</li>
					<li class="float_left1">手机</li>
					<li class="float_left1">地址</li>
					<li class="float_left1">操作</li>

					<li class="clear_float"></li>
				</ul>
			</div>
			<div style="margin-top: 20px;">
				<c:forEach items="${userList}" var="user">
				<ul style="margin-top: 30px;">
					<li class="float_left1">${user.username }</li>
					<li class="float_left1">${user.nickname }</li>
					<li class="float_left1">${user.mobile }</li>
					<li class="float_left1">${user.address }</li>
					<li class="float_left1"><a href="users/delete?id=${userInfo.id}&pagesize=${pagesize}&indexpage=${indexpage}">删除</a>
					</li>
					<li class="clear_float"></li>
				</ul>
				</c:forEach>
			</div>
			<div style="margin-top: 30px;">
				<ul style="margin-top: 30px;">

					<form action="users/findAll" method="post">
						<input type="hidden" name="id" value="${userInfo.id}">
						<li class="float_left">共${tableSize }条记录</li>
						<li class="float_left">每页 <input type="text"
							value="${pagesize}" name="pagesize" style="width: 20px">
							条</li>
						<li class="float_left">第 ${indexpage } 页/共${pageNum}页</li>
						<li class="float_left"><a
							href="users/findAll?id=${userInfo.id}&pagesize=${pagesize}&indexpage=1">第一页</a>
						</li>
						<li class="float_left"><a
							href="users/findAll?id=${userInfo.id}&pagesize=${pagesize}&indexpage=${indexpage-1}">上一页
						</a>
						</li>
						<li class="float_left"><a
							href="users/findAll?id=${userInfo.id}&pagesize=${pagesize}&indexpage=${indexpage+1}">下一页</a>
						</li>
						<li class="float_left"><a
							href="users/findAll?id=${userInfo.id}&pagesize=${pagesize}&indexpage=${pageNum}">最后一页
						</a>
						</li>
						<li class="float_left">转到第 <input type="text" value="1"
							name="indexpage" style="width: 20px"> 页</li>
						<li class="clear_float"><input type="submit" value="提交">
						</li>
					</form>
				</ul>
			</div>
			<div style="margin-top: 30px;">
				<input type="button" value="添加数据" onclick="location.href='<%=basePath%>/jsp/addAccount.jsp'" />
			</div>

		</div>
	</div>
</body>
</html>
